home *** CD-ROM | disk | FTP | other *** search
- unit Nntpr;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, Winshoes;
-
- type
- TformNNTP_R = class(TForm)
- Label1: TLabel;
- editHost: TEdit;
- butnRetrieve: TButton;
- memoMessage: TMemo;
- nntp: TPBE_sNNTP;
- Label2: TLabel;
- editNG: TEdit;
- lablStatus: TLabel;
- procedure butnRetrieveClick(Sender: TObject);
- procedure nntpStatus(const sMessage: String);
- private
- public
- end;
-
- implementation
-
- {$R *.DFM}
-
- procedure TformNNTP_R.butnRetrieveClick(Sender: TObject);
- var
- strm: TFilestream;
- begin
- try
- with nntp do begin
- Host := editHost.Text;
- Connect;
- butnRetrieve.Caption := '..Busy..';
- try
- ModeReader; {This is not needed per RFC, but there are a few improperly configured servuers out there}
- SelectGroup(editNG.Text);
- strm := TFilestream.Create('c:\tempwins.txt', fmCreate);
- with strm do
- try
- GetMessage(MsgLo, strm, strm);
- finally
- free;
- end;
- memoMessage.lines.LoadFromFile('c:\tempwins.txt');
- finally
- Disconnect;
- end;
- end;
- except
- on e: Exception do Application.ShowException(E);
- end;
- butnRetrieve.Caption := '&Retrieve';
- end;
-
- procedure TformNNTP_R.nntpStatus(const sMessage: String);
- begin
- lablStatus.caption := sMessage;
- end;
-
- end.
-